<template>
    <base-breadcrumb :title="$route.meta.title">
        <a-spin :spinning="loading">
            <!-- 表格 -->
            <a-card :bordered="false" v-for="form in list" :key="form.id">
                <a-form-model
                        :model="form"
                        :label-col="{ span: 4 }"
                        :wrapper-col="{ span: 14 }"
                >
                    <a-row>
                        <a-col :span="8">
                            <a-form-model-item label="是否重大变更：">
                                <a-radio-group name="radioGroup" v-model="form.bigChange" disabled>
                                    <a-radio :value="1">
                                        是
                                    </a-radio>
                                    <a-radio :value="0">
                                        否
                                    </a-radio>
                                </a-radio-group>
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="设计变更名称：">
                                <a-input
                                        disabled
                                        v-model="form.name"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="设计变更编号：">
                                <a-input
                                        disabled
                                        v-model="form.num"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="收文日期：">
                                <a-input
                                        disabled
                                        v-model="form.receiptDate"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="发文部门：">
                                <a-input
                                        disabled
                                        v-model="form.sendDepartment"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="接收人：">
                                <a-input
                                        disabled
                                        v-model="form.receiverName"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="是否涉及返工：">
                                <a-radio-group name="radioGroup" v-model="form.rework" disabled>
                                    <a-radio :value="1">
                                        是
                                    </a-radio>
                                    <a-radio :value="0">
                                        否
                                    </a-radio>
                                </a-radio-group>
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="16">
                            <a-form-model-item label="是否涉及索赔：">
                                <a-radio-group name="radioGroup" v-model="form.claim" disabled>
                                    <a-radio :value="1">
                                        是
                                    </a-radio>
                                    <a-radio :value="0">
                                        否
                                    </a-radio>
                                </a-radio-group>
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="主要实施人：">
                                <a-input
                                        disabled
                                        v-model="form.implementerList"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="计划开始时间：">
                                <a-input
                                        disabled
                                        v-model="form.planBegin"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="8">
                            <a-form-model-item label="计划完成时间：">
                                <a-input
                                        disabled
                                        v-model="form.planEnd"
                                        placeholder="请输入"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="24">
                            <a-form-model-item label="内容摘要：">
                                <a-textarea
                                        disabled
                                        v-model="form.options"
                                        placeholder="请输入"
                                        :auto-size="{ minRows: 3, maxRows: 5 }"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="24">
                            <a-form-model-item label="附件上传：">
                                <b-upload
                                        disabled
                                        upload-type="single"
                                        business-code="MM01"
                                        :file-list.sync="form.fileInfos"
                                />
                            </a-form-model-item>
                        </a-col>
                        <a-col :span="16">
                            <a-form-model-item label="是否作废：">
                                <a-radio-group name="radioGroup"  v-model="form.status" disabled>
                                    <a-radio :value="1">
                                        是
                                    </a-radio>
                                    <a-radio :value="0">
                                        否
                                    </a-radio>
                                </a-radio-group>
                            </a-form-model-item>
                        </a-col>
                    </a-row>
                </a-form-model>
            </a-card>
        </a-spin>

        <div class="btn_box page-btn-right-top">
            <a-button @click="$router.back()">关闭</a-button>
        </div>
    </base-breadcrumb>
</template>

<script>
  import {
     getDrawDesign
  } from '@/api/technical/designFM'
  export default {
    name: 'designDrawingChangeDetails',
    data() {
      return {
        loading: false,
        list: [{}],
        id: null
      }
    },
    created() {
      this.id = this.$route.query.id
      this.getDrawDesign()
    },
    methods: {
      getDrawDesign() {
        this.loading = true
        getDrawDesign({ id: this.id }).then(res=>{
          this.loading = false
          this.list = res.data.changeVOS
          this.list.forEach(item=>{
            if(item.status === 'ABOLISH') {
              item.status = 1
            } else {
              item.status = 0
            }
            if(!item.fileInfos) {
              item.fileInfos = []
            }
            if(item.implementerListDTOS?.length) {
              item.implementerList = item.implementerListDTOS.join(',')
            } else {
              item.implementerList = ''
            }
          })
        })
      }
    }
  }
</script>

<style scoped>

</style>